import java.util.LinkedList;
import java.util.Queue;

/**
 * Created with IntelliJ IDEA.
 * User: 12629
 * Date: 2021/11/5
 * Time: 8:50
 * Description:
 */
public class TestDemo {
    public static void main2(String[] args) {
        Queue<TreeNode> queue = new LinkedList<>();
        queue.offer(null);
        queue.offer(null);
        queue.offer(null);
        System.out.println(queue.isEmpty());
        System.out.println(queue.size());

    }
    public static void main(String[] args) {
        TestBinaryTree testBinaryTree = new TestBinaryTree();
        TreeNode root = testBinaryTree.createTree();
        testBinaryTree.preOrderTraversal(root);
        System.out.println();
        testBinaryTree.inOrderTraversal(root);
        System.out.println();
        testBinaryTree.postOrderTraversal(root);
        System.out.println();
        System.out.println("节点的个数：");
        int ret = testBinaryTree.getSize2(root);
        System.out.println(ret);
        System.out.println("叶子节点的个数：");
        testBinaryTree.getLeafSize1(root);
        System.out.println(TestBinaryTree.leafSize);
        System.out.println("高度：");
        System.out.println(testBinaryTree.maxDepth(root));
        try {
            System.out.println("查找：");
            System.out.println(testBinaryTree.find(root,'r').val);
        }catch (NullPointerException e) {
            System.out.println("没有这个节点！");
        }
        System.out.println("层序遍历：");
        testBinaryTree.levelOrderTraversal(root);
        System.out.println();
        System.out.println("是否是完全二叉树：");
        System.out.println(testBinaryTree.isCompleteTree(root));
    }
}
